import request from '@/axios'
import type { ListParams, Response } from '@/api/api'

export interface Row {
  id: number
  no: string
  name: string
  deliver_driver_id: string
  warehouse_id: string
  store_ids: string
}

export interface FormData {
  id?: number
  no: string
  name: string
  deliver_driver_id: string
  warehouse_id: string
  store_ids: string
}
// 运单列表
export const getListApi = (data: ListParams): Promise<Response<Row>> => {
  return request.post({ url: '/deliver/task/list', data })
}

// 运单列表删除
export const delUserApi = (data: { id: string }): Promise<IResponse> => {
  return request.post({ url: '/deliver/task/del', data })
}

// 运单列表详情
export const detailsApi = (data: { id: string }): Promise<IResponse> => {
  return request.post({ url: '/deliver/task/details', data })
}

// 运单列表订单列表
export const orderApi = (data): Promise<IResponse> => {
  return request.post({ url: '/deliver/task/order', data })
}
